/**
 * @class 拉尼亚凯亚超结构体
 * @author DuskyHuang 圣子
 * @description 宇宙大尺度范围
*/

import { _decorator, instantiate } from 'cc';
import { LAYER_MAIN_3D, Res } from 'const';
import { createNodeAt, setParticles } from 'helpers';
import { core } from 'cfw';
import { CosmicScope } from './cosmic-scope';
const { ccclass } = _decorator;

@ccclass('cocosmos.LaniakeaComplex')
export class LaniakeaComplex extends CosmicScope {

    protected _substructure_key: substructures = 'clusters';
    protected _attenuation: attenuation = [8.5, 8.8, 9.5, 10];

    protected createSubParticles(): void {
        this._subparts = createNodeAt("Perversive Galaxies-SCs", LAYER_MAIN_3D, this.node);
        const GalaxiesGUP = core.res.getPrefab(GALAXIES_GPU);
        [NearSC, FarSC,
            // VeryFarSC
        ].forEach(args => setParticles(instantiate(GalaxiesGUP), args, this._subparts));
    }

    protected approachScope1stTime(): void {
        console.log("DO TASK", this.node.name);
    }
}

const { Prefabs: { GALAXIES_GPU } } = Res;

const NearSC: IParticleLike = {
    num: 3000,
    sizes: [0.036, 0.06],
    radius: 10,
    thickness: 0.6,
    random: 0.3,
};

const FarSC: IParticleLike = {
    num: 6000,
    sizes: [0.06, 0.12],
    radius: 20,
    thickness: 0.5,
    random: 0.4,
};

// const VeryFarSC: IParticleLike = {
//     num: 12000,
//     sizes: [0.2, 0.5],
//     radius: 80,
//     thickness: 0.3,
//     random: 0.5,
// };
